<?PHP
class Event
{
	private $handlers;
	function Event()
	{
		$this->handlers = array();
	}
	function add($handler)
	{
		$this->handlers[] = &$handler;
	}
	function call($sender, $args)
	{
		foreach ($this->handlers as $handler)
		{
			$handler->call($sender, $args);
		}
	}
}
?>
